package com.example.blog_system_ssm.component;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

// 统一异常处理功能
@RestControllerAdvice
public class MyExceptionAdvice {

    @ExceptionHandler(Exception.class)
    public AjaxResult doException(Exception e){
        return AjaxResult.fail(-1,e.getMessage());
    }
}
